﻿// Mootools
function ajaxSubmit() {
    var url = '/Ashx/Acc/Staff/GroupAdminInfoForm.ashx';
    var postArgs = $('form1').toQueryString();
    new Ajax(url, { data: postArgs, onComplete: function () { alert('ok'); } }).request();
}

window.addEvent('domready', function () {
    try {
        $('bs').addEvent('click', function () {
            window.location.href = '/s/?kw=' + $('kw').get('value');
        });
    } catch (e) { }
    try {
        var url = '/Ashx/Acc/Staff/GroupAdminInfoForm.ashx';
        //var postArgs = $('form1').toQueryString();
        $('Send').addEvent('click', function (e) {
            //new Request.HTML({ url: url }).post($('form1'));
            var req = new Request({
                url: url,
                method: 'Post',
                evalScripts: true,
                onSuccess: function (responseText) {
                    var json = eval("(" + responseText + ")");
                    alert(json.message.m_StringValue);
                    window.location.href = window.location.search;
                    //$('result').set('text', responseText);
                },
                onFailure: function () {
                    alert('No');
                    //$('result').set('text', 'The request failed.');
                }
            }).send($('form1'));
        });
    } catch (e) { }
});
// JQuery
$(function () {
    $('#bs').click(function () {
        window.location.href = '/s/?kw=' + $('#kw').val();
    });
    $('#Send').click(function () {
        window.location.href = '/s/?kw=456';
    });
});